package com.ruoyi.qiushi.service.system.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.qiushi.domain.system.QiushiTaskRecord;
import com.ruoyi.qiushi.mapper.system.QiushiTaskRecordMapper;
import com.ruoyi.qiushi.service.system.IQiushiTaskRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 任务完成记录Service业务层处理
 *
 * @author ruoyi
 * @date 2024-01-16
 */
@Service
public class QiushiTaskRecordServiceImpl implements IQiushiTaskRecordService {
    @Autowired
    private QiushiTaskRecordMapper qiushiTaskRecordMapper;

    /**
     * 查询任务完成记录
     *
     * @param id 任务完成记录主键
     * @return 任务完成记录
     */
    @Override
    public QiushiTaskRecord selectQiushiTaskRecordById(Long id) {
        return qiushiTaskRecordMapper.selectQiushiTaskRecordById(id);
    }

    /**
     * 查询任务完成记录列表
     *
     * @param qiushiTaskRecord 任务完成记录
     * @return 任务完成记录
     */
    @Override
    public List<QiushiTaskRecord> selectQiushiTaskRecordList(QiushiTaskRecord qiushiTaskRecord) {
        return qiushiTaskRecordMapper.selectQiushiTaskRecordList(qiushiTaskRecord);
    }

    /**
     * 新增任务完成记录
     *
     * @param qiushiTaskRecord 任务完成记录
     * @return 结果
     */
    @Override
    public int insertQiushiTaskRecord(QiushiTaskRecord qiushiTaskRecord) {
        qiushiTaskRecord.setCreateTime(DateUtils.getNowDate());
        return qiushiTaskRecordMapper.insertQiushiTaskRecord(qiushiTaskRecord);
    }

    /**
     * 修改任务完成记录
     *
     * @param qiushiTaskRecord 任务完成记录
     * @return 结果
     */
    @Override
    public int updateQiushiTaskRecord(QiushiTaskRecord qiushiTaskRecord) {
        qiushiTaskRecord.setUpdateTime(DateUtils.getNowDate());
        return qiushiTaskRecordMapper.updateQiushiTaskRecord(qiushiTaskRecord);
    }

    /**
     * 批量删除任务完成记录
     *
     * @param ids 需要删除的任务完成记录主键
     * @return 结果
     */
    @Override
    public int deleteQiushiTaskRecordByIds(Long[] ids) {
        return qiushiTaskRecordMapper.deleteQiushiTaskRecordByIds(ids);
    }

    /**
     * 删除任务完成记录信息
     *
     * @param id 任务完成记录主键
     * @return 结果
     */
    @Override
    public int deleteQiushiTaskRecordById(Long id) {
        return qiushiTaskRecordMapper.deleteQiushiTaskRecordById(id);
    }
}
